<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ~ Copyright © 2013-2016 The Nxt Core Developers.                            ~
  ~ Copyright © 2016-2017 Jelurida IP B.V.                                    ~
  ~                                                                           ~
  ~ See the LICENSE.txt file at the top-level directory of this distribution  ~
  ~ for licensing information.                                                ~
  ~                                                                           ~
  ~ Unless otherwise agreed in a custom licensing agreement with Jelurida B.V.,
  ~ no part of the Nxt software, including this file, may be copied, modified,~
  ~ propagated, or distributed except according to the terms contained in the ~
  ~ LICENSE.txt file.                                                         ~
  ~                                                                           ~
  ~ Removal or modification of this copyright notice is prohibited.           ~
  ~                                                                           ~
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->

<div class="modal fade" id="create_poll_modal" data-transaction-type="1" data-transaction-subtype="2" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" data-i18n="create_poll">Create Poll</h4>
            </div>
            <div class="modal-body">            
                <form role="form" autocomplete="off">
                    <div class="callout callout-danger error_message" style="display:none"></div>
                    <div class="form-group">
                        <label for="create_poll_name" data-i18n="name">Name</label>
                        <input type="text" class="form-control" name="name" id="create_poll_name" placeholder="Poll Name" data-i18n="[placeholder]poll_name" autofocus tabindex="1" />
                    </div>
                    <div class="form-group">
                        <label for="create_poll_description" data-i18n="description">Description</label>
                        <textarea class="form-control" id="create_poll_description" name="description" rows="2" tabindex="2"></textarea>
                    </div>
                     <div class="row">
                        <div class="col-xs-12 col-sm-12 col-md-12" id="create_poll_type_group">
                            <div class="form-group">
                                <label for="create_poll_type" data-i18n="poll_by">Poll By</label>
                                <select name="votingModel" id="create_poll_type" class="form-control" data-default="0" tabindex="3">
                                    <option selected value="0" data-i18n="vote_by_account">Vote by Account</option>
                                    <option value="1" data-i18n="vote_by_balance">Vote by Account Balance</option>
                                    <option value="2" data-i18n="vote_by_asset">Vote by Asset Balance</option>
                                    <option value="3" data-i18n="vote_by_currency">Vote by Currency Balance</option>
                                </select>
                            </div>
                        </div>
                        <div class="col-xs-12 col-sm-12 col-md-12" aria-hidden="true" id="create_poll_asset_id_group" style="display: none;">
                            <div class="form-group poll_holding_asset" data-modal-ui-element="add_asset_modal_ui_element"></div>
                        </div>
                        <div class="col-xs-12 col-sm-12 col-md-12" aria-hidden="true" id="create_poll_ms_currency_group" style="display: none;">
                            <div class="form-group poll_holding_currency" data-modal-ui-element="add_currency_modal_ui_element"></div>
                        </div>

                    </div>

                    <div class="row">
                        <div class="col-xs-12 col-sm-12 col-md-12" aria-hidden="true" id="create_poll_min_balance_type_group">
                            <label for="create_poll_min_balance_type" data-i18n="min_balance_type">Min Balance Type</label>
                            <div id="create_poll_min_balance_type" class="form-group">
                                <label class="radio-inline">
                                    <input type="radio" name="minBalanceType" id="create_poll_min_balance_type_0" data-default="0" value="0" checked /><span> </span>
                                    <span data-i18n="none">None</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="minBalanceType" id="create_poll_min_balance_type_1" data-default="1" value="1"/><span> </span>
                                    <span data-i18n="account_balance">Account Balance</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="minBalanceType" id="create_poll_min_balance_type_2" data-default="2" value="2"/><span> </span>
                                    <span data-i18n="asset_balance">Asset Balance</span>
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="minBalanceType" id="create_poll_min_balance_type_3" data-default="3" value="3"/><span> </span>
                                    <span data-i18n="currency_balance">Currency Balance</span>
                                </label>
                            </div>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-xs-6 col-sm-6 col-md-6">
                            <div class="form-group">
                                <label for="create_poll_min_balance">
                                    <span data-i18n="min_voting_balance">Min Voting Balance</span> 
                                    (<span data-i18n="none" id="min_voting_balance_label_unit">None</span>)
                                </label>
                                <input name="minBalance" id="create_poll_min_balance" min="0" disabled class="form-control" placeholder="" data-default="0" value="0" tabindex="5">
                            </div>
                        </div>
                        <div class="col-xs-6 col-sm-6 col-md-6">
                            <div class="form-group create_poll_finish_height" data-modal-ui-element="block_height_modal_ui_element"></div>
                        </div>
                    </div>
                    <div class="form-group" id="create_poll_answers">
                        <label data-i18n="answers">Answers</label>
                         <div class="form-group">
                            <div class="input-group">
                                <input type="text" class="form-control create_poll_answers" name="create_poll_answers[]" placeholder="Answer" data-i18n="[placeholder]answer" tabindex="5" />
                                <span class="input-group-btn">
                                    <button class="btn remove_answer" type="button"><i class="fa fa-minus" style="color:white"></i></button>
                                </span>
                            </div>
                        </div>
                         <div class="form-group">
                            <div class="input-group">
                                <input type="text" class="form-control create_poll_answers" name="create_poll_answers[]" placeholder="Answer" data-i18n="[placeholder]answer" tabindex="5" />
                                <span class="input-group-btn">
                                    <button class="btn remove_answer" type="button"><i class="fa fa-minus" style="color:white"></i></button>
                                </span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <a href="#" class="btn btn-primary" id="create_poll_answers_add"><i class="fa fa-plus"></i> <span data-i18n="add_answer">Add answer</span></a>
                    </div>
                    <div class="row">
                        <div class="col-xs-6 col-sm-6 col-md-6">
                            <div class="form-group">
                                <label for="create_poll_min_options" data-i18n="minimum_nr_choices">Minimum Nr Of Choices</label>
                                <input type="number" name="minNumberOfOptions" id="create_poll_min_options" min="1" class="form-control" placeholder="" data-default="1" value="1" tabindex="6">
                            </div>
                        </div>
                        <div class="col-xs-6 col-sm-6 col-md-6">
                            <div class="form-group">
                                <label for="create_poll_max_options" data-i18n="maximum_nr_choices">Maximum Nr Of Choices</label>
                                <input type="number" name="maxNumberOfOptions" id="create_poll_max_options" min="1" class="form-control" placeholder="" data-default="1" value="1" tabindex="7">
                            </div>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-xs-6 col-sm-6 col-md-6">
                            <div class="form-group">
                                <label for="create_poll_min_range_value" data-i18n="minimum_range_value">Minimum Range Value</label>
                                <input type="number" name="minRangeValue" id="create_poll_min_range_value" min="0" class="form-control" placeholder="" data-default="0" value="0" tabindex="8">
                            </div>
                        </div>
                        <div class="col-xs-6 col-sm-6 col-md-6">
                            <div class="form-group">
                                <label for="create_poll_max_range_value" data-i18n="maximum_range_value">Maximum Range Value</label>
                                <input type="number" name="maxRangeValue" id="create_poll_max_range_value" min="1" class="form-control" placeholder="" data-default="1" value="1" tabindex="9">
                            </div>
                        </div>
                    </div>
                    <div data-replace-with-modal-template="fee_calculation_modal_template"></div>
                    <div data-replace-with-modal-template="secret_phrase_modal_template"></div>
                    <div data-replace-with-modal-template="advanced_deadline_template"></div>
                    <div data-replace-with-modal-template="advanced_approve_template"></div>
                    <div data-replace-with-modal-template="advanced_rt_hash_template"></div>
                    <div data-replace-with-modal-template="advanced_broadcast_template"></div>
                    <div data-replace-with-modal-template="advanced_note_to_self_template"></div>

                    <input type="hidden" name="request_type" value="createPoll" />
                </form>
            </div>
            <div class="modal-footer" style="margin-top:0;">
                <div class="advanced_info"><a href="#" data-i18n="advanced">advanced</a></div>

                <button type="button" class="btn btn-default" data-dismiss="modal" data-i18n="cancel">Cancel</button>
                &nbsp;&nbsp;
                <button type="button" class="btn btn-primary" data-loading-text="Submitting..." data-i18n="create_poll;[data-loading-text]submitting">Create Poll</button>
            </div>
        </div>
    </div>
</div>

<!-- http://bootsnipp.com/search?q=poll -->

<div class="modal fade" id="cast_vote_modal" data-transaction-type="1" data-transaction-subtype="3" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" data-i18n="cast_vote">Cast Vote</h4>
            </div>
            <div class="modal-body">            
                <form role="form" autocomplete="off">
                    <div class="callout callout-danger error_message" style="display:none"></div>
                    <div class="form-group">
                        <label for="cast_vote_poll_name" data-i18n="poll_name">Poll Name</label><br/>
                        <input type="hidden" id="cast_vote_poll" name="poll" value=""/>
                        <span id="cast_vote_poll_name" data-i18n="[placeholder]poll_name"></span>
                    </div>
                    <div class="form-group">
                        <label for="cast_vote_poll_description" data-i18n="description">DESCRIPTION</label><br/>
                        <span id="cast_vote_poll_description"></span>
                    </div>
                    <div class="form-group">
                        <label for="cast_vote_range" data-i18n="range">Range</label><br/>
                        <span id="cast_vote_range"></span>
                    </div>
                    <div class="form-group" id="cast_vote_answers">
                        <div id="cast_vote_answers_entry"></div>
                    </div>
                    <div data-replace-with-modal-template="fee_calculation_modal_template"></div>
                    <div data-replace-with-modal-template="secret_phrase_modal_template"></div>
                    <div data-replace-with-modal-template="advanced_deadline_template"></div>
                    <div data-replace-with-modal-template="advanced_approve_template"></div>
                    <div data-replace-with-modal-template="advanced_rt_hash_template"></div>
                    <div data-replace-with-modal-template="advanced_broadcast_template"></div>
                    <div data-replace-with-modal-template="advanced_note_to_self_template"></div>
                    
                    <input type="hidden" name="request_type" value="castVote" />
                </form>
            </div>
            <div class="modal-footer" style="margin-top:0;">
                <div class="advanced_info"><a href="#" data-i18n="advanced">advanced</a></div>
                <button type="button" class="btn btn-default" data-dismiss="modal" data-i18n="cancel">Cancel</button>
                &nbsp;&nbsp;
                <button type="button" class="btn btn-primary" data-loading-text="Submitting..." data-i18n="cast_vote;[data-loading-text]submitting">Cast Vote</button>
            </div>
        </div>
    </div>
</div>



<div class="modal fade" id="poll_results_modal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" data-i18n="poll_results">Poll Results</h4>
            </div>
            <div class="modal-body">    
                <ul class="nav nav-pills nav-justified" style="margin-bottom:10px">
                    <li class="active" id="poll_results_statistics_nav" data-tab="statistics"><a href="#" data-i18n="poll_results">Poll Results</a></li>
                    <li data-tab="voters"><a href="#" data-i18n="votes_cast">Votes Cast</a></li>
                </ul>

                <div id="poll_results_modal_statistics" class="poll_results_modal_content" style="display:none">
                    <div class="callout callout-danger" id="poll_results_warning" style="display:none"></div>
    
                    <table class="table" id="poll_results_table" style="margin-bottom:0;table-layout:fixed;">
                        <thead>
                            <tr>
                                <th data-i18n="option">Option</th>
                                <th data-i18n="result">Result</th>
                                <th data-i18n="weight">Weight</th>
                            </tr>
                        </thead>
                        <tbody id="poll_results_options">                                

                        </tbody>
                    </table>
                 </div>

                <div id="poll_results_modal_voters" class="poll_results_modal_content" style="display:none">     
                    <table class="table" id="poll_voters_table" style="margin-bottom:0;table-layout:fixed;">
                        <thead>

                        </thead>
                        <tbody>
                            
                        </tbody>
                    </table>
                    
                </div>
                <div class="modal-footer" style="margin-top:0;">
                <button type="button" class="btn btn-primary" data-dismiss="modal" data-i18n="close">Close</button>
                </div>
            </div>
        </div>
    </div>
</div>


<div class="modal fade" id="add_followed_poll_modal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" data-i18n="add_poll">Add Poll</h4>
                <div class="modal-body">
                    <form role="form" autocomplete="off">
                        <div class="callout callout-danger error_message" style="display:none"></div>
                        <div class="form-group">
                            <label for="add_followed_poll_id" data-i18n="poll_id">POLL ID</label> <i class="fa fa-question-circle show_popover" style="color:#4CAA6E" data-content="Find the ID on the issuer's website or announcement page." data-container="body" data-i18n="[data-content]find_asset_id_help"></i>
                            <input type="text" class="form-control" name="id" id="add_followed_poll_id" placeholder="ID" autofocus tabindex="1" />
                        </div>
                        <input type="hidden" name="request_type" value="addFollowedPoll" />
                    </form>
                </div>
            </div>
            <div class="modal-footer" style="margin-top:0;">
                <button type="button" class="btn btn-default" data-dismiss="modal" data-i18n="cancel">Cancel</button>
                <button type="button" class="btn btn-primary" data-loading-text="Submitting..." data-i18n="add_poll;[data-loading-text]submitting">Add Poll</button>
            </div>
        </div>
    </div>
</div>